<template>
  <div class="complaint-details">
    <div class="sub-page-header">
      <el-tooltip content="点击返回企业判定监测" placement="left">
        <div class="title" @click="goBack">
          <el-button icon="el-icon-arrow-left" type="text"></el-button>
          {{ view ? '企业判定审批详情' : '企业判定审批' }}
        </div>
      </el-tooltip>
      <!-- <el-button type="primary" size="small" @click="exportData">导出</el-button> -->
    </div>
    <div class="content" v-if="detailsInfo">
      <details-info :com-info="detailsInfo"></details-info>
    </div>
    <empty v-else></empty>
  </div>
</template>

<script>
import { getEnterpriseDetail } from '@api/modules/enterprise.js'

import Empty from '@com/Empty.vue'
import DetailsInfo from './components/detailsInfo.vue'

export default {
  name: 'judgAlgorithmDetails',
  components: {
    // NavStepItem,
    Empty,
    DetailsInfo,
  },
  data() {
    return {
      id: '',
      view: '',
      detailsInfo: null,
    }
  },
  computed: {},
  created() {
    const { id, view } = this.$route.params
    this.id = id
    this.view = view
    if (this.id) {
      this.getDetailData()
    }
  },
  methods: {
    // 获取企业详情
    getDetailData() {
      getEnterpriseDetail({ id: this.id }).then(res => {
        if (res.code === 0) {
          this.detailsInfo = res.data
        }
      })
    },
    goBack() {
      this.$router.back(-1)
    },
  },
  beforeDestroy() {},
}
</script>

<style lang="scss" scoped>
.complaint-details {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  padding: 20px;
  .content {
    @include flex-1;
  }
}
</style>
